import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Index',
        component: () => import('./home'),
        redirect: '/table',
        children:[
            {
                path:"table", //桌位
                name:"Table",
                component:()=>import('./table'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"order", //订单
                name:"Order",
                component:()=>import('./order'),
                meta:{
                    keepAlive:true,
                }
            },

            {
                path:"variety-dishes", //菜品 上传
                name:"VarietyDishes",
                component:()=>import('./variety-dishes'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"printer", //打印
                name:"printer",
                component:()=>import('./printer'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"report", //报表
                name:"report",
                component:()=>import('./report'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"distribution", //配送
                name:"distribution",
                component:()=>import('./distribution'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"member", //会员
                name:"member",
                component:()=>import('./member'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"channel", //渠道
                name:"channel",
                component:()=>import('./channel'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"customer", //客户
                name:"customer",
                component:()=>import('./customer'),
                meta:{
                    keepAlive:true,
                }
            },
            {
                path:"marketing", //营销
                name:"marketing",
                component:()=>import('./marketing'),
                meta:{
                    keepAlive:true,
                }
            }
        ],
    },
    {
        path:"/catering-menu", //菜单 点餐
        name:"CateringMenu",
        component:()=>import('./catering-menu'),
        meta:{
            keepAlive:true,
        }
    },
    {
        path:"/settle-accounts", //结算
        name:"SettleAccounts",
        component:()=>import('./settle-accounts'),
        meta:{
            keepAlive:true,
        }
    },
    {
        path:"/variety-dishes/add-product", //添加产品
        name:"add-product",
        component:()=>import('./variety-dishes/add-product'),
        meta:{
            keepAlive:true,
        }
    },
    {
        path:"/order/order-detail", //订单详情
        name:"order-detail",
        component:()=>import('./order/order-detail'),
        meta:{
            keepAlive:true,
        }
    },
]

const router = new VueRouter({
    mode:"hash",//history
    routes
})

export default router